define(['knockout'], function (ko) {
    function ViewModel(params) {
        this._css = {};
        this._style = {};
        this._event = {};
        this._fieldValue = ko.observable();
        var fValue = params.record[params.field.name]();

        if(fValue){
            if(fValue<1024) {this._fieldValue(fValue + ' B'); return;}
            if(fValue<1024*1024) {this._fieldValue((fValue/1024).toFixed(2) + ' KB'); return;}
            if(fValue<1024*1024*1024) {this._fieldValue((fValue/(1024*1024)).toFixed(2) + ' MB'); return;}

            this._fieldValue((fValue/(1024*1024*1024)).toFixed(2) + ' GB');
        }
    }

    return ViewModel;
});
